package com.wgw.controller;

import com.wgw.entity.Librarian;
import com.wgw.service.LibrarianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wgw1206798585@vip.qq.com
 * @version 1.0
 * @date 2020-03-13 19:16
 */


/**
 * restcontroller可以返回字符串的东西
 * 相当于  controller+responsebody
 * <p>
 * RestController是responsebody+Controller两个注解的合体，一般就拿来直接传json数据
 */
@RestController
public class LibrarianController {
    @Autowired
    private LibrarianService librarianService;

    @GetMapping("/getLibrarianInfo")
    public Librarian getLibrarianInfo(int id) {
        System.out.println("您要查询的ID是：" + id);
        return librarianService.selectLibrarian(id);
    }
}
